<?php 
session_start();

// var_dump($_POST);
$_POST['pwd']=md5($_POST['pwd']);
include_once('../public/function.php');
$config = include_once('../public/config.php');
$where =" where `user`= '{$_POST['user']}'and `pwd`='{$_POST['pwd']}'";
$res = select($config,'user',$where);
// var_dump($res[0]['user']);die;
if($res){
	echo "<script>alert('".$res[0]['user']."登陆成功');window.location.href='index.php'</script>";
	$_SESSION['name']=$res[0]['user'];
	$_SESSION['islogin']=1;

}else{
	echo '<script>alert("登陆失败,账号密码不匹配");window.location.href="index.php"</script>';

}

 ?>